﻿<%@ Assembly Name="JM.JCY.SharePointComponent, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a3f76d78e78426e2" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="HomeAnnounceUserControl.ascx.cs"
    Inherits="JM.JCY.SharePointComponent.Announcement.HomeAnnounce.HomeAnnounceUserControl" %>
<link type="text/css" rel="Stylesheet" href="/_layouts/JM.JCY.Resource/jQueryPlugin/themes/base/style-newsticker.css"  media="screen"/>
<script type="text/javascript" src="/_layouts/JM.JCY.Resource/jQueryPlugin/ui/jcarousellite_1.0.1c4.js"></script>

<script type="text/javascript">
    $(function () {
        $("#NewsList").jCarouselLite({
            vertical: true,
            hoverPause: true,
            btnPrev: ".previous",
            btnNext: ".next",
            visible: 3,
            auto: 2500,
            speed: 800
        });
    });
</script>

<script type="text/javascript">

    $(document).ready(function () {
        $("#tdAnnToggle1").click(function () {
            var div = document.getElementById("divToggleAnnounce");
            if (div.style.display == "") {
                div.style.display = "none";
                $("#imgToggleAnnounce").attr("src", "/_layouts/JM.JCY.Resource/images/toggle_expand.png");

            }
            else {
                div.style.display = "";
                $("#imgToggleAnnounce").attr("src", "/_layouts/JM.JCY.Resource/images/toggle_collapse.png");

            }
        });
    });

    $(document).ready(function () {
        $("#tdAnnToggle2").click(function () {
            var div = document.getElementById("divToggleAnnounce");
            if (div.style.display == "") {
                div.style.display = "none";
                $("#imgToggleAnnounce").attr("src", "/_layouts/JM.JCY.Resource/images/toggle_expand.png");

            }
            else {
                div.style.display = "";
                $("#imgToggleAnnounce").attr("src", "/_layouts/JM.JCY.Resource/images/toggle_collapse.png");

            }
        });
    });


    function RedirectToViewCurrentAnnounce(sender, AnnounceId) {
        var URIScheme = "http://";
        var host = document.location.host;
        var url = URIScheme + host + "/AnnouncePages/ViewAnnounceDetail.aspx?AnnounceId=" + AnnounceId;
        sender.href = url;
    }

    function RedirectToSearchAnnounce(sender) {

        var URIScheme = "http://";
        var host = document.location.host;
        var url = URIScheme + host + "/AnnouncePages/SearchAnnounce.aspx";
        sender.href = url;
    }

</script>
<div>
    <table class="main" width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
            <td>
                <table width="450" class="webpart" cellpadding="0" cellspacing="0">
                     <tr>
                        <th align="left" id="tdAnnToggle1" class="title" width="90%" style="cursor: pointer">
                            <img src="/_layouts/JM.JCY.Resource/images/broadcast_logo.png" width="24" />
                            通知通告
                        </th>
                        <th id="tdAnnToggle2"class="link" align="right" width="10%" style="cursor: pointer">
                         
                            <img class="toggle" id="imgToggleAnnounce" src="/_layouts/JM.JCY.Resource/images/toggle_collapse.png" />
                        </th>
                    </tr>

                 
                    <tr>
                        <td colspan="2">
                            <div id="divToggleAnnounce">
                                <table width="100%" class="webpartContent">
                                               <tr width="100%">
                                    <td width="100%">
                                       <asp:DataList ID="dlAnnounce" runat="server" RepeatColumns="1" OnItemDataBound="dlAnnounce_ItemDataBound" Width="100%">
                                                    <ItemTemplate>
                                                        <hr runat="server" id="hr" />
                                                        <table>
                                                        <tr>
                                                        <td colspan="2">
                                                         <asp:Label ID="lblEffDate" runat="server" Text='<%# Eval("CREATED_TIME") %>'></asp:Label>
                                                           <asp:Label ID="lblStatus" runat="server" Text='<%# Eval("ReadStatus") %>' Visible="false"></asp:Label>
                                                        </td>
                                                        </tr>
                                                            <tr>
                                                                <td valign="top" width="10%">
                                                                 <asp:Image ID="Image1" runat="server" Width="20"/>
                                                                </td>
                                                           
                                                                <td valign="top" align="left">
                                                                    <asp:LinkButton ID="lbSubject" runat="server"  Font-Size=Small Font-Bold="true" Text='<%#Eval("Subject")%>'
                                                                        OnClientClick='<%# String.Format("RedirectToViewCurrentAnnounce({0},{1})","this",Eval("ID")) %>'></asp:LinkButton>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </ItemTemplate>
                                                </asp:DataList>
                                    </td>
                                    </tr>

                         
                                    
                              

                                    <tr><td align="right">    <asp:LinkButton ID="lbViewAll" runat="server" OnClientClick="RedirectToSearchAnnounce(this)">更多...</asp:LinkButton></td></tr>
                                </table>
                            </div>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</div>
